#include <stdio.h>

int main(int argc,char *argv[])
{
    double a;
    double b;
    double result = 0;

    char operator;

    printf("Please input numA:\n");
    scanf("%lf",&a);

    printf("Please input numB:\n");
    scanf("%lf",&b);

    getchar();
    printf("Please input operator:\n");
    scanf("%c",&operator);

    switch(operator)
    {
        case '+':
        {
            result = a + b;
            break;
        }   
        case '-':
        {
            result = a - b;
            break;
        }
        case '*':
        {
            result = a * b;
            break;
        }
        case '/':
        {
            if(b == 0)
            {
                printf("error: numB is zore!\n");
                break;
            }
            result = a / b;
            break;

        }
        default:
        {
            printf("errro:operator\n");
            break;
        }
        
    }
    printf("result = %lf\n",result);

    //printf("a = %lf b = %lf operator = %c\n", a, b, operator);

    return 0;
}